# ~*~ coding: utf-8 ~*~
from apps.blueprints import perms_blueprint
from .views import PermissionMenuAPI, \
    PermissionListAPI, PermissionListView, PermissionUpdateView, PermissionCreateView, PermissionDeleteView, \
    RoleListAPI, RoleListView, RoleUpdateView, RoleCreateView, RoleDeleteView

perms_blueprint.add_url_rule('/api/permission/', view_func=PermissionListAPI.as_view('api-permission-list'))
perms_blueprint.add_url_rule('/api/permission/menu/', view_func=PermissionMenuAPI.as_view('api-permission-menu'))
perms_blueprint.add_url_rule('/permission/', view_func=PermissionListView.as_view('permission-list'))
perms_blueprint.add_url_rule('/permission/create/', view_func=PermissionCreateView.as_view('permission-create'))
perms_blueprint.add_url_rule('/permission/<uuid:pk>/update/', view_func=PermissionUpdateView.as_view('permission-update'))
perms_blueprint.add_url_rule('/permission/<uuid:pk>/delete/', view_func=PermissionDeleteView.as_view('permission-delete'))

perms_blueprint.add_url_rule('/api/role/', view_func=RoleListAPI.as_view('api-role-list'))
perms_blueprint.add_url_rule('/role/', view_func=RoleListView.as_view('role-list'))
perms_blueprint.add_url_rule('/role/create/', view_func=RoleCreateView.as_view('role-create'))
perms_blueprint.add_url_rule('/role/<uuid:pk>/update/', view_func=RoleUpdateView.as_view('role-update'))
perms_blueprint.add_url_rule('/role/<uuid:pk>/delete/', view_func=RoleDeleteView.as_view('role-delete'))

